//
//  ZLExciseBeginHeaderView.m
//  ZLExamination
//
//  Created by leilei on 2017/9/3.
//  Copyright © 2017年 Zheng. All rights reserved.
//

#import "ZLExciseBeginHeaderView.h"

@implementation ZLExciseBeginHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.numberLbl];
        [self addSubview:self.titleLbl];
//        [self addSubview:self.examNameLbl];
        [self addSubview:self.timeLbl];
    }
    return self;
}
#pragma mark - 布局
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_numberLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(12);
        make.centerY.equalTo(self);
    }];
    
    [_titleLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_numberLbl.mas_right).offset(15);
        make.width.mas_equalTo(67);
        make.height.mas_equalTo(17);
        make.centerY.equalTo(self);
    }];
    [_timeLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.height.equalTo(@44);
        make.right.mas_equalTo(-12);
//        make.width.equalTo(@150);
    }];
//    [_examNameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.right.mas_equalTo(-12);
//        make.centerY.equalTo(self);
//    }];
}

#pragma mark - lazy load
- (UILabel *)numberLbl {
    if (!_numberLbl) {
        _numberLbl = [[UILabel alloc] init];
        _numberLbl.font = kMyFont(14);
        _numberLbl.textColor = kMY_BLUE_COLOR;
    }
    return _numberLbl;
}

- (UILabel *)titleLbl {
    if (!_titleLbl) {
        _titleLbl = [[UILabel alloc] init];
        _titleLbl.font = kMyFont(11);
        _titleLbl.textColor = [UIColor whiteColor];
        _titleLbl.textAlignment = NSTextAlignmentCenter;
        _titleLbl.layer.cornerRadius = 6;
        _titleLbl.layer.backgroundColor = [kMY_BLUE_COLOR CGColor];
        _titleLbl.text = @"单项选择题";
    }
    return _titleLbl;
}
- (UILabel *)timeLbl {
    if (!_timeLbl) {
        _timeLbl = [[UILabel alloc] init];
        _timeLbl.textColor = [UIColor blackColor];
        _timeLbl.hidden = YES;
    }
    return _timeLbl;
}
//- (UILabel *)examNameLbl {
//    if (!_examNameLbl) {
//        _examNameLbl = [[UILabel alloc] init];
//        _examNameLbl.font = kMyFont(12);
//        _examNameLbl.textColor = [UIColor grayColor];
//        _examNameLbl.text = @"2017年公务员考试卷(春季)";
//    }
//    return _examNameLbl;
//}

@end
